package com.custom.base.dialog

import android.util.Log
import com.custom.base.manager.SDActivityManager.Companion.instance

/**
 * 作者：
 * 时间：2017/4/6.
 * 说明：调用dialog
 */
object SDMyDialog {
    /**
     * 取消
     */
    fun cancel(dialog: LoadingDialog) {
        dialog.cancel()
    }
    /**
     * 加载中
     * @param msg 加载描述
     * @return
     */
    fun loading(): LoadingDialog {
        Log.e("~~~", "loading: " )
        return LibraryDialog.loading(instance.lastActivity)
    }

    /**
     * 警告
     *
     * @param msg 警告描述
     * @return
     */
    fun warning(msg: String = "警告"): TipsToast {
        return LibraryDialog.warning(instance.lastActivity, msg)
    }

    /**
     * 成功
     *
     * @param msg 成功描述
     * @return
     */
    fun success(msg: String = "成功"): TipsToast {
        return LibraryDialog.success(instance.lastActivity, msg)
    }

    /**
     * 失败
     *
     * @param msg 失败描述
     * @return
     */
    fun fail(msg: String = "失败"): TipsToast {
        return LibraryDialog.fail(instance.lastActivity, msg)
    }

    /**
     * 笑脸
     *
     * @return
     */
    fun laugh(): TipsToast {
        return LibraryDialog.laugh(instance.lastActivity)
    }
}